#include "Halt.h"
#include "ResourceMgr.h"
#include "GameController.h"
#include "Gfx.h"
#include <stdlib.h>

#include <iostream>
using namespace std;

Halt *Halt::instance_ = NULL;

void
Halt::
start () {
	GameComponent::start();

  cout << "Halting Brick And Blast" << endl;

  // If this component is not a leaf component
  // trigger another one
	//switch_to("nextComponentId");
  // Killing the resource manager will free the memory
	// allocated for all the resources
  ResourceMgr::instance()->kill();
	// Killing the game controller will kill all the
	// game components
  GameController::instance()->kill();
	// Killing the gfx will quit SDL
  Gfx::instance()->kill();

  // Quit with SUCCESS status
  exit (EXIT_SUCCESS);
}

void
Halt::
stop () {
	GameComponent::stop();

}

